package com.inifitness.tenant.core.system.converter;


import java.util.List;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.inifitness.common.model.Option;
import com.inifitness.tenant.core.system.model.entity.BizRole;
import com.inifitness.tenant.core.system.model.form.BizRoleForm;
import com.inifitness.tenant.core.system.model.vo.BizRolePageVO;

import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 角色对象转换器
 *
 * @author sunjinfeng
 * @since 2024/04/18 11:00:00
 */
@Mapper(componentModel = "spring")
public interface BizRoleConverter {

  Page<BizRolePageVO> entity2Page(Page<BizRole> page);


  @Mapping(target = "value", source = "id")
  @Mapping(target = "label", source = "name")
  Option entity2Option(BizRole role);


  List<Option> entities2Options(List<BizRole> roles);

  BizRole form2Entity(BizRoleForm bizRoleForm);

  BizRoleForm entity2Form(BizRole entity);
}